home *** CD-ROM | disk | FTP | other *** search
- /* ----------------------------------------------------------------------
-
- SoundLevel XFCN
- version 1.0.0
-
- Written by: Paul Celestin
-
- Copyright © 1996 Celestin Company, Inc.
-
- This XFCN returns the current sound level.
-
- No parameters required!
-
- 960707 - 1.0.0 - initial release
-
- ---------------------------------------------------------------------- */
-
- #include <A4Stuff.h>
- #include <HyperXCmd.h>
- #include <Sound.h>
-
- #define PARAMETER_NUMS 0
- #define PARAMETER_TEXT "\pNo parameters required!"
-
-
- /* ----------------------------------------------------------------------
- prototypes
- ---------------------------------------------------------------------- */
- void DoIt(XCmdPtr paramPtr);
- char LookUp[256];
-
-
- /* ----------------------------------------------------------------------
- main
- ---------------------------------------------------------------------- */
- pascal void main(XCmdPtr paramPtr)
- {
- Str255 copyright = "\pCopyright © 1996 Celestin Company, Inc.";
- long oldA4 = SetCurrentA4();
- if (paramPtr->paramCount != PARAMETER_NUMS)
- {
- paramPtr->returnValue =
- PasToZero(paramPtr,PARAMETER_TEXT);
- }
- else
- {
- DoIt( paramPtr );
- }
- SetA4(oldA4);
- }
-
- /* ----------------------------------------------------------------------
- DoIt
- ---------------------------------------------------------------------- */
- void DoIt(XCmdPtr paramPtr)
- {
- short theVolume;
- Str255 theString;
-
- GetSoundVol(&theVolume);
- NumToStr(paramPtr,theVolume,theString);
-
- paramPtr->returnValue = PasToZero(paramPtr,theString);
- }
-